package com.cn.jsdr.service.serviceImpl;

import com.cn.jsdr.common.SqlConfig;
import com.cn.jsdr.service.RediService;
import com.cn.jsdr.service.UpdateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class UpdateServiceImpl implements UpdateService {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    @Autowired
    private RediService rediService;
    @Override
    public int update(String sqlid, Map<String, Object> map) {
        Map m = rediService.getSql(sqlid);
        String sql = SqlConfig.getUpdateSql(m,map);
        return  jdbcTemplate.update(sql);
    }
}
